using System;
using System.Drawing;
using System.Runtime.InteropServices;

namespace ns1
{
	internal class Class4
	{
		public enum Enum0
		{
			Undefined = -1,
			Left,
			Top,
			Right,
			Bottom
		}

		private struct Struct0
		{
			public uint uint_0;

			public IntPtr intptr_0;

			public uint uint_1;

			public uint uint_2;

			public Struct1 struct1_0;

			public int int_0;
		}

		private struct Struct1
		{
			public int int_0;

			public int int_1;

			public int int_2;

			public int int_3;
		}

		private const int int_0 = 3;

		private const int int_1 = 0;

		private const int int_2 = 2;

		private const int int_3 = 1;

		private const int int_4 = 5;

		private const uint uint_0 = 48u;

		private Struct0 struct0_0;

		public Enum0 Enum0_0 => (Enum0)struct0_0.uint_2;

		public Rectangle Rectangle_0
		{
			get
			{
				Struct1 @struct = default(Struct1);
				IntPtr intPtr = Marshal.AllocHGlobal(Marshal.SizeOf(@struct));
				int num = SystemParametersInfo(48u, 0u, intPtr, 0u);
				@struct = (Struct1)Marshal.PtrToStructure(intPtr, @struct.GetType());
				if (num == 1)
				{
					Marshal.FreeHGlobal(intPtr);
					return new Rectangle(@struct.int_0, @struct.int_1, @struct.int_2 - @struct.int_0, @struct.int_3 - @struct.int_1);
				}
				return new Rectangle(0, 0, 0, 0);
			}
		}

		[DllImport("user32.dll")]
		private static extern IntPtr FindWindow(string string_0, string string_1);

		[DllImport("shell32.dll")]
		private static extern uint SHAppBarMessage(uint uint_1, ref Struct0 struct0_1);

		[DllImport("user32.dll")]
		private static extern int SystemParametersInfo(uint uint_1, uint uint_2, IntPtr intptr_0, uint uint_3);

		public void method_0(string string_0, string string_1)
		{
			struct0_0 = default(Struct0);
			struct0_0.uint_0 = (uint)Marshal.SizeOf(struct0_0.GetType());
			if (FindWindow(string_0, string_1) != IntPtr.Zero)
			{
				if (SHAppBarMessage(5u, ref struct0_0) != 1)
				{
					throw new Exception("Failed to communicate with the given AppBar");
				}
				return;
			}
			throw new Exception("Failed to find an AppBar that matched the given criteria");
		}

		public void method_1()
		{
			method_0("Shell_TrayWnd", null);
		}
	}
}
